// QuadState.h: interface for the CQuadState class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_QUADSTATE_H__66EB8B32_B5F5_4BD5_8AB6_6248CB19138B__INCLUDED_)
#define AFX_QUADSTATE_H__66EB8B32_B5F5_4BD5_8AB6_6248CB19138B__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "Quad3D.h"
//////////////////////////////////////////////////////////////////////////
//等比
#define FACTOR_SCALE_SLIDE      .95f

#define DISTANCE_COVER          4.5
//中心角度
#define DEGREE_COVER            90
//间隙
#define DISTANCE_INTERVAL       4.5

#define DEPTH_Z                 2.5

#define DEPTH_INTERVAL          -2.5


//mesh状态集
class CQuadPlayState
{
public:
    CQuadPlayState(ArrayQuad3D& rQuad3DSlides, int icenterSlide = -1);
    virtual ~CQuadPlayState();


    //设置中心粒子偏移定位
    void    CenterOffsetPos(float fAxisAngleFactor);

    //设置两侧粒子群偏移定位
    void    SlidesOffsetPos(CVector& rV3OffsetFactor);

    //设置中心粒子偏移定位
    void    SlidesRotateOffsetPos(int iIndex, float fAxisAngleFactor);

    //定位初始化
    void    Init();

    //粒子群复位
    void    reset();

    //添加新粒子，返回索引
    int     AddParticle(bool isLeft, CQuad3D* pQuad);
    void    DelParticle(bool isLeft, int iIndex);

    //设定为中心粒子
    void    SetCenterParticle(bool isLeft, int iNO);
    void    SetCenterParticle(int iIndex);

    //查询粒子所在边
    int     QuerySlideDir(int iIndex);
    //
    void    Render();

    int    click(int x, int y);

public:
    //
    GLcolor4    m_clrBackGround;
    bool        m_enReflectionEffect;

    //群粒子matrix
    float       m_angle;    //deg
    float       m_spacing;  //间隙
    //中心点坐标
    float       m_offsetX;
    float       m_offsetZ;

    //
    int         m_centerSlide;
    std::vector<int> m_leftSlides;
    std::vector<int> m_rightSlides;
    //ref set
    ArrayQuad3D& m_rQuad3DSlides;
};


//////////////////////////////////////////////////////////////////////////
#endif // !defined(AFX_QUADSTATE_H__66EB8B32_B5F5_4BD5_8AB6_6248CB19138B__INCLUDED_)
